//
//  OADepartTests.m
//  OANetworkManager_Tests
//
//  Created by TFAppleWork-Summer on 2018/2/24.
//  Copyright © 2018年 GuoRui. All rights reserved.
//

#import "Tests.h"
#import <JRDB/JRDBMgr.h>
#import "AppNetworkingManager+OADepartment.h"
#import "OAUserModel.h"
#import "OADepartmentModel.h"
@interface OADepartTests : Tests

@end

@implementation OADepartTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
     [[JRDBMgr shareInstance] registerClazzes:@[ [OAUserModel class], [OADepartmentModel class] ]];
    [[JRDBMgr shareInstance] setDefaultDatabasePath:@"/Users/Summer/Desktop/haha.sqlite"];
    [JRDBMgr shareInstance].debugMode = YES;
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
}
-(void)testDepart{
 
    
    [self expectation:^(void (^fulfill)(void)) {
        [AppNetworkingManager getDepartNeedUpdate:^(id object, NSError *error) {
            if (error) {
                NSLog(@"error:%@",error.description);
                fulfill();
                
                return ;
            }
            if ([object boolValue]) {
                NSLog(@"需要更新（弹框）");
            }else{
                NSLog(@"不需要更新组织架构");
                fulfill();
            }
            
        } complete:^(id object, NSError *error) {
            if (error) {
                NSLog(@"error:%@",error.description);
                return ;
            }
            if ([object boolValue]) {
                NSLog(@"最新组织架构本地存储完毕（收框）");
            }
             fulfill();
        }];
    }];
}
- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
